home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CICA 1995 August
/
CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso
/
disc2
/
demo
/
gcp_24.exe
/
TERM.BA_
/
TERM.BA
Wrap
Text File
|
1994-04-22
|
3KB
|
101 lines
Option Explicit
Global Const NewSess = 1
Global Const PrevSess = 0
Global Const OpenPrevSess = 2
Global Const modal = 1
Global Const CASCADE = 0
Global Const TILE_HORIZONTAL = 1
Global Const TILE_VERTICAL = 2
Global Const ARRANGE_ICONS = 3
Type FormState
Deleted As Integer
Dirty As Integer
Session As String
Path As String
NewFlag As Integer
Phone As String
LastDialUp As String
ModemInitString As String
Dial As String
End Type
Global FState() As FormState
Global Document() As New frmNotePad
Global Const IniFile = "gcp.ini"
Global Const AppName = "VT-220 for Workgroups"
Global Const DefaultSessionName = "untitled"
Global FIndex As Integer ' global so that Notepad load can use it
Global CurrentKey As Integer
Global Disconnect As Integer
Global ExitFlag As Integer
Global FirstTime As Integer 'flag for command line input
Sub CenterForm (frmParent As Form, frmChild As Form)
' This procedure centers a child form over a parent form.
' Calling this routine loads the dialog. Use the Show method
' to display the dialog after calling this routine ( ie MyFrm.Show 1)
Dim l, t
' get left offset
l = frmParent.Left + ((frmParent.Width - frmChild.Width) / 2)
If (l + frmChild.Width > screen.Width) Then
l = screen.Width = frmChild.Width
End If
' get top offset
t = frmParent.Top + ((frmParent.Height - frmChild.Height) / 2)
If (t + frmChild.Height > screen.Height) Then
t = screen.Height - frmChild.Height
End If
' center the child formfv
frmChild.Move l, t
End Sub
Function FindFreeIndex () As Integer
Dim i As Integer
Dim ArrayCount As Integer
ArrayCount = UBound(Document)
' Cycle throught the document array. If one of the
' documents has been deleted, then return that
' index.
For i = 1 To ArrayCount
If FState(i).Deleted Then
FindFreeIndex = i
FState(i).Deleted = False
Exit Function
End If
Next
' If none of the elements in the document array have
' been deleted, then increment the document and the
' state arrays by one and return the index to the
' new element.
ReDim Preserve Document(ArrayCount + 1)
ReDim Preserve FState(ArrayCount + 1)
FindFreeIndex = UBound(Document)
End Function
Function Sessions () As Integer
Dim i As Integer
Dim cnt As Integer
' Cycle throught the document array.
' Return # documents remaining.
cnt = 0
For i = 1 To UBound(Document)
If Not FState(i).Deleted Then
cnt = cnt + 1
End If
Next
Sessions = cnt
End Function